﻿<Page x:Class="SoftTeach.View.Wochenpläne.MetroWochenplanPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:softTeach="clr-namespace:SoftTeach"
      xmlns:wochenpläneViewModel="clr-namespace:SoftTeach.ViewModel.Wochenpläne"
      xmlns:wochenpläne="clr-namespace:SoftTeach.View.Wochenpläne"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	    Title="Wochenplan"
      DataContext="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=WochenplanWorkspace}"
      FontSize="16">
  <Page.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/SoftTeach;component/Resources/MetroResources.xaml"/>
        <ResourceDictionary >
          <DataTemplate DataType="{x:Type wochenpläneViewModel:TerminplanEintragCollection}">
            <wochenpläne:TerminplaneinträgeDetailView />
          </DataTemplate>
          <DataTemplate DataType="{x:Type wochenpläneViewModel:GanztagstermineViewModel}">
            <wochenpläne:GanztagstermineDetailView />
          </DataTemplate>
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Page.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="*"/>
      <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Background="{StaticResource MetroHeaderBackground}">
      <Label Content="{Binding WochenplanÜberschrift}" Foreground="White" HorizontalAlignment="Center"/>
    </Border>
    <Button Grid.Row="1" Grid.Column="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding PreviousWeekCommand}">
      <Canvas Height="100" Width="40">
        <Polygon Points="5,50 30,10 30,90" Stroke="Gray">
          <Polygon.Fill>
            <LinearGradientBrush StartPoint="1,0" EndPoint="0,0">
              <GradientBrush.GradientStops>
                <GradientStopCollection>
                  <GradientStop Color="#888888" Offset="0"/>
                  <GradientStop Color="White" Offset="1"/>
                </GradientStopCollection>
              </GradientBrush.GradientStops>
            </LinearGradientBrush>
          </Polygon.Fill>
          <Polygon.Effect>
            <DropShadowEffect ShadowDepth="4" Direction="310" Color="Black" Opacity="0.4"/>
          </Polygon.Effect>
        </Polygon>
      </Canvas>
    </Button>
    <Button Grid.Row="1" Grid.Column="2" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding NextWeekCommand}">
      <Canvas Height="100" Width="40">
        <Polygon Points="30,50 5,10 5,90" Stroke="Gray">
          <Polygon.Fill>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
              <GradientBrush.GradientStops>
                <GradientStopCollection>
                  <GradientStop Color="#888888" Offset="0"/>
                  <GradientStop Color="White" Offset="1"/>
                </GradientStopCollection>
              </GradientBrush.GradientStops>
            </LinearGradientBrush>
          </Polygon.Fill>
          <Polygon.Effect>
            <DropShadowEffect ShadowDepth="4" Direction="310" Color="Black" Opacity="0.4"/>
          </Polygon.Effect>
        </Polygon>
      </Canvas>
    </Button>

    <Grid Grid.Row="1" Grid.Column="1"  x:Name="PlanGrid" Background="{StaticResource OverlayBackgroundBrush}">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" MinHeight="35"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
        <RowDefinition MinHeight="40"/>
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" MinWidth="100"/>
        <ColumnDefinition MinWidth="100"/>
        <ColumnDefinition MinWidth="100"/>
        <ColumnDefinition MinWidth="100"/>
        <ColumnDefinition MinWidth="100"/>
        <ColumnDefinition MinWidth="100"/>
      </Grid.ColumnDefinitions>
      <Border Grid.Row="2" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan1Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan1Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan2Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan2Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="4" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan3Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan3Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="5" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan4Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan4Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="6" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan5Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan5Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="7" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan6Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan6Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="8" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan7Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan7Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="9" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan8Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan8Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="10" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan9Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan9Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Grid.Row="11" Grid.Column="0" Style="{StaticResource WochenplanRowHeaderBorder}">
        <TextBlock>
          <Bold><Run Text="{Binding Path=Wochenplan10Bezeichnung, Mode=OneWay}"></Run></Bold><LineBreak/>
          <Run Text="{Binding Path=Wochenplan10Zeit, Mode=OneWay}"></Run>
        </TextBlock>
      </Border>
      <Border Style="{StaticResource WochenplanHeaderBorder}" Grid.Row="0" Grid.Column="1">
        <Label Style="{StaticResource WochenplanHeaderText}">Montag</Label>
      </Border>
      <Border Style="{StaticResource WochenplanHeaderBorder}" Grid.Row="0" Grid.Column="2">
        <Label Style="{StaticResource WochenplanHeaderText}">Dienstag</Label>
      </Border>
      <Border Style="{StaticResource WochenplanHeaderBorder}" Grid.Row="0" Grid.Column="3">
        <Label Style="{StaticResource WochenplanHeaderText}">Mittwoch</Label>
      </Border>
      <Border Style="{StaticResource WochenplanHeaderBorder}" Grid.Row="0" Grid.Column="4">
        <Label Style="{StaticResource WochenplanHeaderText}">Donnerstag</Label>
      </Border>
      <Border Style="{StaticResource WochenplanHeaderBorder}" Grid.Row="0" Grid.Column="5">
        <Label Style="{StaticResource WochenplanHeaderText}">Freitag</Label>
      </Border>
      <Border Grid.Row="1" Grid.Column="0">
        <Label>Ganztagstermine</Label>
      </Border>
      <ContentControl Grid.Row="1" Grid.Column="1" Content="{Binding Path=Wochenplan10}"/>
      <ContentControl Grid.Row="2" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan11Span}" Content="{Binding Path=Wochenplan11}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="3" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan12Span}" Content="{Binding Path=Wochenplan12}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="4" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan13Span}" Content="{Binding Path=Wochenplan13}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="5" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan14Span}" Content="{Binding Path=Wochenplan14}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="6" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan15Span}" Content="{Binding Path=Wochenplan15}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="7" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan16Span}" Content="{Binding Path=Wochenplan16}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="8" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan17Span}" Content="{Binding Path=Wochenplan17}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="9" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan18Span}" Content="{Binding Path=Wochenplan18}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="10" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan19Span}" Content="{Binding Path=Wochenplan19}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="11" Grid.Column="1" Grid.RowSpan="{Binding Path=Wochenplan110Span}" Content="{Binding Path=Wochenplan110}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>

      <ContentControl Grid.Row="1" Grid.Column="2" Content="{Binding Path=Wochenplan20}"/>
      <ContentControl Grid.Row="2" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan21Span}" Content="{Binding Path=Wochenplan21}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="3" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan22Span}" Content="{Binding Path=Wochenplan22}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="4" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan23Span}" Content="{Binding Path=Wochenplan23}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="5" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan24Span}" Content="{Binding Path=Wochenplan24}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="6" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan25Span}" Content="{Binding Path=Wochenplan25}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="7" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan26Span}" Content="{Binding Path=Wochenplan26}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="8" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan27Span}" Content="{Binding Path=Wochenplan27}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="9" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan28Span}" Content="{Binding Path=Wochenplan28}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="10" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan29Span}" Content="{Binding Path=Wochenplan29}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="11" Grid.Column="2" Grid.RowSpan="{Binding Path=Wochenplan210Span}" Content="{Binding Path=Wochenplan210}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>

      <ContentControl Grid.Row="1" Grid.Column="3" Content="{Binding Path=Wochenplan30}"/>
      <ContentControl Grid.Row="2" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan31Span}" Content="{Binding Path=Wochenplan31}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="3" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan32Span}" Content="{Binding Path=Wochenplan32}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="4" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan33Span}" Content="{Binding Path=Wochenplan33}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="5" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan34Span}" Content="{Binding Path=Wochenplan34}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="6" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan35Span}" Content="{Binding Path=Wochenplan35}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="7" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan36Span}" Content="{Binding Path=Wochenplan36}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="8" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan37Span}" Content="{Binding Path=Wochenplan37}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="9" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan38Span}" Content="{Binding Path=Wochenplan38}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="10" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan39Span}" Content="{Binding Path=Wochenplan39}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="11" Grid.Column="3" Grid.RowSpan="{Binding Path=Wochenplan310Span}" Content="{Binding Path=Wochenplan310}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>

      <ContentControl Grid.Row="1" Grid.Column="4" Content="{Binding Path=Wochenplan40}"/>
      <ContentControl Grid.Row="2" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan41Span}" Content="{Binding Path=Wochenplan41}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="3" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan42Span}" Content="{Binding Path=Wochenplan42}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="4" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan43Span}" Content="{Binding Path=Wochenplan43}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="5" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan44Span}" Content="{Binding Path=Wochenplan44}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="6" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan45Span}" Content="{Binding Path=Wochenplan45}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="7" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan46Span}" Content="{Binding Path=Wochenplan46}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="8" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan47Span}" Content="{Binding Path=Wochenplan47}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="9" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan48Span}" Content="{Binding Path=Wochenplan48}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="10" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan49Span}" Content="{Binding Path=Wochenplan49}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="11" Grid.Column="4" Grid.RowSpan="{Binding Path=Wochenplan410Span}" Content="{Binding Path=Wochenplan410}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>

      <ContentControl Grid.Row="1" Grid.Column="5" Content="{Binding Path=Wochenplan50}"/>
      <ContentControl Grid.Row="2" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan51Span}" Content="{Binding Path=Wochenplan51}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="3" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan52Span}" Content="{Binding Path=Wochenplan52}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="4" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan53Span}" Content="{Binding Path=Wochenplan53}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="5" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan54Span}" Content="{Binding Path=Wochenplan54}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="6" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan55Span}" Content="{Binding Path=Wochenplan55}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="7" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan56Span}" Content="{Binding Path=Wochenplan56}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="8" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan57Span}" Content="{Binding Path=Wochenplan57}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="9" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan58Span}" Content="{Binding Path=Wochenplan58}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="10" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan59Span}" Content="{Binding Path=Wochenplan59}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
      <ContentControl Grid.Row="11" Grid.Column="5" Grid.RowSpan="{Binding Path=Wochenplan510Span}" Content="{Binding Path=Wochenplan510}" ContextMenu="{Binding Path=TerminplanContextMenu}"/>
    </Grid>
  </Grid>
</Page>
